package dk.ahp.getmeoff;

import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.content.BroadcastReceiver;

public class ArrivalAlarmActivity extends AbstractActivity implements OnClickListener {
	private Button stopAlarmButton;
	private Ringtone ringTone;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_arrival_alarm);
		
		stopAlarmButton = (Button)findViewById(R.id.stopAlarmButton);
		stopAlarmButton.setOnClickListener(this);
		
		//start playing ring tone
		
		Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
		ringTone = RingtoneManager.getRingtone(getApplicationContext(), notification);
		ringTone.play();
	}

	@Override
	public void onClick(View v) { 
		ringTone.stop();
		finish();
	}
	
}
